// Lang_17 ['null' keyword].nova // The application class. class NullKeywordApp { // Application class's "main" function. public static void main( String[] args ) { // Declare a reference. // All new uninitialized references are automatically null. Integer i; // Call "method" with a null argument. method0( null ); // Check if i is not null. if ( i != null ) { Stream.writeLine( "i is not null." ); } else { Stream.writeLine( "i is null." ); } // Create a new "B" object. B b = new B( ); // Check if b's "b" attribute is null. if ( b.b == ( null ) ) { Stream.writeLine( "b is null." ); } else { Stream.writeLine( "b is not null." ); } } private static Integer method0( Integer i ) { // Return null. return null; } // Used to demonstrate ambiguous method calls when passing "null" arguments. // Uncomment this method to get the "ambiguous method call" compilation error. /* private static String method0( String s ) { return s; }*/ } class B { // Instance attribute. public Boolean b; // Empty constructor. public B( ) { // Attribute "b" will remain null. } }